package com.mindainfo.groundwave.server.base.dao;

import org.springframework.stereotype.Repository;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import javax.annotation.Resource;

/**
 * Created by MD-01 on 2017/5/9.
 */
@Repository
public class JedisDao {

    @Resource
    private JedisPool pool;

    public Integer getId(String key){
        Jedis jedis = pool.getResource();
        Long id = jedis.incr(key);
        jedis.close();
        return id.intValue();
    }
}
